<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<title>登录</title> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/layer.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/images/login.js"></script>
<link href="${pageContext.request.contextPath }/css/login2.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>SoleMemory~~~登录<sup>V2017</sup></h1>

<div class="login" style="margin-top:50px;">
    
    <div class="header">
        <div class="switch" style="left: 145px" id="switch"><a class="switch_btn_focus" id="switch_qlogin" href="javascript:void(0);" tabindex="7">Sole~登录</a>
		<div class="switch_bottom" id="switch_bottom" style="position: absolute; width: 64px; left: 0px;"></div>
        </div>
    </div>    
  
    
    <div class="web_qr_login" id="web_qr_login" style="display: block; height: 235px;">    

            <!--登录-->
            <div class="web_login" id="web_login">
               
               
               <div class="login-box">
    
            
			<div class="login_form">
				<form action="" name="loginform" accept-charset="utf-8" id="login_form" class="loginForm" method="post">
				<input type="hidden" name="did" value="0"/>
               <input type="hidden" name="to" value="log"/>
                <div class="uinArea" id="uinArea">
                <label class="input-tips" for="u">帐号：</label>
                <div class="inputOuter" id="uArea">
                    
                    <input type="text" id="loginName_login" name="username" class="inputstyle"/>
                </div>
                </div>
                <div class="pwdArea" id="pwdArea">
               <label class="input-tips" for="p">密码：</label> 
               <div class="inputOuter" id="pArea">
                    
                    <input type="password" id="password_login" name="password" class="inputstyle"/>
                </div>
                </div>
               
                <div style="padding-left:50px;margin-top:20px;"><input type="button" id="submit" value="登 录" style="width:150px;" class="button_blue"/></div>
              </form>
           </div>
           
            	</div>
               
            </div>
            <!--登录end-->
  </div>

  <%-- <!--注册-->
    <div class="qlogin" id="qlogin" style="display: none; ">
   
    <div class="web_login"><form name="form2" id="regUser" accept-charset="utf-8"  action="${pageContext.request.contextPath }/userlog/regist" method="post">
	      <input type="hidden" name="to" value="reg"/>
		      		       <input type="hidden" name="did" value="0"/>
        <ul class="reg_form" id="reg-ul">
        		<div id="userCue" class="cue">快速注册请注意格式</div>
                <li>
                	
                    <label for="user"  class="input-tips2">用户名：</label>
                    <div class="inputOuter2">
                        <input type="text" id="userName" name="userName" maxlength="16" class="inputstyle2"/>
                    </div>
                    
                </li>
                
                <li>
                	
                    <label for="user"  class="input-tips2">登录名：</label>
                    <div class="inputOuter2">
                        <input type="text" id="loginName" name="loginName" maxlength="16" class="inputstyle2"/>
                    </div>
                    
                </li>
                <li>
                <label for="passwd" class="input-tips2">密码：</label>
                    <div class="inputOuter2">
                        <input type="password" id="passwd"  name="password" maxlength="16" class="inputstyle2"/>
                    </div>
                    
                </li>
                <li>
                <label for="passwd2" class="input-tips2">确认密码：</label>
                    <div class="inputOuter2">
                        <input type="password" id="passwd2" name="" maxlength="16" class="inputstyle2" />
                    </div>
                    
                </li>
                
                <li>
                 <label for="qq" class="input-tips2">邮箱：</label>
                    <div class="inputOuter2">
                       
                        <input type="text" id="email" name="email" maxlength="50" class="inputstyle2"/>
                    </div>
                   
                </li>
                
                <li>
                 <label for="qq" class="input-tips2">性别：</label>
                    <div class="inputOuter2">
                       
                        <input type="radio" id="sex" value="1" name="sex"/> 男
                        <input type="radio" id="sex" value="1" name="sex"/> 女
                    </div>
                   
                </li>
                
                <li>
                    <div class="inputArea">
                        <input type="button" id="reg"  style="margin-top:10px;margin-left:85px;" class="button_blue" value="同意协议并注册"/> <a href="javascript:void(0)" class="zcxy" target="_blank">注册协议</a>
                    </div>
                    
                </li><div class="cl"></div>
            </ul></form>
    </div>
   
    
    </div> --%>
    <!--注册end-->
</div>

<script type="text/javascript">

$(function(){
	
	$("#submit").click(function(){
		var username = $("#loginName_login").val();
		var password = $('#password_login').val();
		
		if(username == "" || $.trim(username) == "" || password == "" || $.trim(password) == ""){
			layer.open({
				 title: '提示信息',
				 content: '用户名或者密码不能为空，请重新输入！'
			});
			return false;
		}
		
		$.post("${pageContext.request.contextPath }/userlog/login",{"username":username,"password":password},function(data){
			
			if(data == "1"){ //管理员
				location.href = "${pageContext.request.contextPath }/toAdminPage";   //跳转管理员页面
			}else if(data == "2"){//照片审核员
				location.href = "${pageContext.request.contextPath }/toPhotoPage";   //跳转照片审核员页面
			}else{ //查询用户为空
				layer.open({
					 title: '提示信息',
					 content: '用户名或者密码错误，请重新输入！'
				});
				return false;
			}
		});
	});
});

</script>
</body></html>